% ==== Step 1: 构造一个 DSM ====
DSM=zeros(17,17);
DSM(1,3)=1; DSM(2,3)=1; DSM(3,4)=1; DSM(3,5)=1; DSM(3,6)=1;
DSM(4,3)=1; DSM(4,9)=1; DSM(5,3)=1; DSM(5,14)=1; DSM(6,3)=1;
DSM(6,12)=1; DSM(7,6)=1; DSM(8,4)=1; DSM(9,13)=1; DSM(10,5)=1;
DSM(11,5)=1; DSM(12,16)=1; DSM(13,8)=1; DSM(14,15)=1;
DSM(15,10)=1; DSM(15,11)=1; DSM(16,7)=1; DSM(17,5)=1;

% ==== Step 2: 构造一个 chromosome ====
% 5 个组件划分为 2 个模块（行表示模块，列表示组件）
% 每列有且仅有一个 1
% 比如：[模块1: 组件1,2,4]，模块2: 组件3,5
chromosome = [
    1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
];


% ==== Step 4: 调用目标函数 ====
fitness = calculateFitness(chromosome, DSM);

% ==== Step 5: 显示结果 ====
fprintf('计算得到的适应度（fitness_for_ga）为: %.4f\n', fitness);
